﻿using ASmile.Helpers;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;

namespace ASmile.Extern.Lib.HttpCore
{
    /// <summary>
    /// 新 Http 实现，封装了 HttpEasy 的共通 2023.1.13
    /// </summary>
    public class HttpClient : HttpEasy
    {
        public HttpClient() { }

        public HttpClient(string rootUrl)
        {
            RootUrl = rootUrl;
        }

        public HttpClient(string rootUrl, string baseUrl)
        {
            RootUrl = rootUrl;
            BaseUrl = baseUrl;
        }

        protected override void OnRequest(HttpWebRequest request)
        {
            base.OnRequest(request);
            //request.Headers[Config.Settings.TokenName] = TokenHelper.TokenValue;
        }

        /// <summary>
        /// action　前面的路径
        /// </summary>
        protected virtual string BaseUrl { get; }
    }
}